#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: title02.py 
@version:
@time: 2023/05/13
排列组合：(牛客搜索)NC61.两数之和
"""
from typing import List


class Solution:
    def twoSum(self, numbers: List[int], target: int) -> List[int]:
        res = []
        hash_map = {}
        for i in range(len(numbers)):
            tmp = target - numbers[i]
            if tmp not in hash_map:
                hash_map[numbers[i]] = i
            else:
                res.append(hash_map[tmp] + 1)
                res.append(i + 1)
                break
        return res


assert Solution().twoSum([1, 2, 3, 4, 5], 5) == [2, 3]
print("验证通过")
